package com.xu.t1.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 为Redisson实例连接redis的配置类
 *
 * @author xu
 *
 */

@Configuration
public class RedissonConfig {

    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://60.205.147.180:6379")
                .setPassword("redis123456");
        return Redisson.create(config);
    }
}